home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Utils Divers 1 / Horo Shareware / Horo / Horo.rsrc / TEXT_1564_T4. Commands.txt < prev    next >
Text File  |  1996-03-01  |  7KB  |  103 lines

  1. TextCt Commands
  2.   TextCt commands are executed via the Dyna dispatching procedure found in the file "FaceProcXY" (or in some other form compatible with your programming environment):
  3.   Dyna(theCtl,command,a,b,c,d);    {Pascal}
  4.   Dyna(theCtl,command,a,b,c,d);     /* C */
  5.   call Dyna(theCtl,command,a,b,c,d) !Fortran
  6. where "theCtl" is the ControlHandle of a TextCt control (obtained in cControl after calling GetCtl to get control info), and the "command" parameter is one of the integer constants from the include file "TxtCtlStorXY".  WARNING:  If you save the ControlHandle, it will become invalid if the control is disposed of or reformed by hitting "Apply" or "OK" in ViewIt's Bounds or Control dialogs.
  7.   Several other points apply to the operation of all or most TextCt commands:
  8. ΓÇó If an error occurs during execution of a TextCt command, then the fRec variable uResult is set equal to a value less than zero.  Unless otherwise specified below, this value will be equal to the negative index of the corresponding error string from STR# 1551.
  9. ΓÇó When uRect is used to define a text selection for use with or returned by a TextCt command, its elements refer to 0-based line and column numbers:  top = line number of selection start, left = column number of selection start, bottom = line number of selection end, and right = column number of selection end.
  10. ΓÇó When parameter d is used to define the autoscrolling mode (the manner in which the current selection should be scrolled into view), four options are currently supported:  -2 = no autoscrolling and no vertical bar update, -1 = no autoscrolling but update vertical scroll bar, 0 = autoscroll to center of window, and +n = autoscroll into view at n lines from bottom of window (where 1 = at bottom).
  11.   Each TextCt command name, its equivalent number, the parameters and record elements used by the command, and a complete description of the command are presented here.
  12.  
  13. Name  Number  Parameters & Variables used
  14. OpnCTxt 1551 a,b,uName
  15. Opens the file named uName into the editor, according to the parameters a and b, where,
  16.   a = directory specifier (current directory is preserved)
  17.    0 = current directory
  18.    1 = System folder
  19.    other = a working directory reference number
  20.   b = file-opening mode
  21.    0 or 1 = use file contents to replace all of existing text
  22.    2 = use file contents to replace existing selection
  23.    3 = append file contents to existing text
  24. The working directory reference number of the opened file is saved in tcVRef, and its file name in the control's title.  Passing an empty string in uName can be used to break the connection between an editor and a disk file without affecting the current text in the editor.
  25.  
  26. SavCTxt 1552 a,b,c,d,uName
  27. Saves the text in the editor to a file whose name is equal to uName, according to parameters a, b, c, and d, where,
  28.   a = directory specifier (current directory is preserved)
  29.    0 = current directory
  30.    1 = System folder
  31.    other = a working directory reference number
  32.   b = file-saving mode
  33.    0 = save all of text
  34.    1 = save selected text only
  35.   c = file type (0 = "TEXT")
  36.   d = file creator (0 = application creator = fCreator)
  37. The working directory reference number of the saved file is saved in tcVRef, and its file name in the control's title.  As with OpnCTxt, passing an empty string in uName can be used to break the connection between an editor and a disk file without affecting the current text in the editor.
  38.   The optional file and creator types must be in the form of 4-byte integers, but most languages support assigning 4-character strings to long integers.  For example, to pass the file type "MYTP", use 'MYTP' with C, longint('MYTP') with Pascal, or assign 'MYTP' to an integer*4 in Fortran and pass this integer to SavCTxt.
  39.  
  40. GetCTxt 1555 uI2,uI4,uRect,uResult,uMenuΓǪ
  41. Closes any gaps in the existing text block and returns info about the block where,
  42.   uResult = handle to unlocked text block in memory (handle size ΓëÑ # of char.s)  CAUTION:  This handle refers to the actual text in the editor, not a copy.  Characters in the block can be replaced, but do not attempt to change the size of the block without using a TextCt command to do so.
  43.   uI2 = # of lines = # of carriage returns + 1 (max uI2 returned = 30,000 lines)
  44.   uI4 = # of characters
  45.   uMenuID = selection start (0-based character number)
  46.   uMenuItem = selection end
  47.   uRect = text selection bounds
  48.  
  49. SelCTxt 1556 a,b,c,d,uRect,uResult
  50. Changes the current text selection to that specified by the parameters a, b, and c.  Use negative values of a to also delete the newly selected text.
  51.   a = selection mode
  52.    0 = don't change selection (but will autoscroll)
  53.    ┬▒1 = select all
  54.    ┬▒2 = use uRect to define the selection
  55.    ┬▒3 = use line numbers defined by b and c
  56.    ┬▒4 = use character numbers defined by b and c
  57.    ┬▒5 = select all of current line
  58.   b = selection start (0-based line or character number)
  59.   c = selection end
  60.   d = autoscroll mode
  61.   uResult = number of resulting characters selected
  62.                  or -1 if the selection range did not change
  63. In addition, when using a = ┬▒4, negative values of b and c can be used to designate the following character positions:
  64.   -1 = current selection start
  65.   -2 = current selection end
  66.   -3 = beginning of current line
  67.   -4 = end of current line
  68.   -5 = beginning of previous line
  69.   -6 = end of previous line
  70.   -7 = beginning of next line
  71.   -8 = end of next line
  72.  
  73. PrnCTxt 1564 a,uResult
  74. Prints the currently selected text where a = 0 designates that the standard printing dialogs should first be displayed, and a = -1 prints the selection without displaying the dialogs.  If making successive calls to PrnCTxt for the same editor, always use a = 0 at least once to ensure valid printing parameters for that editor.  When displaying dialogs, control returns with uResult set equal to -1 if the user presses "Cancel" to cancel one of the dialogs.
  75.  
  76. LineCIO 1565 a,b,d,uString,uResult
  77. Moves one line of text to or from an editor via uString, according to a and b where (CR = carriage return),
  78.   a = line I/O mode
  79.    -3 = read text to left of insertion bar
  80.    -2 = read text to left of insertion bar and insert new CR
  81.    -1 = read line from selected text (up to 255 char.s)
  82.      0 = no I/O (but will autoscroll)
  83.    +1 = insert line into editor (uString is preserved)
  84.    +2 = insert line into editor and add a carriage return
  85.   b = ASCII value of optional break character to use when I/O mode = a < -1  (e.g., if b = 9 = TAB, then only char.s back to previous TAB are returned)
  86.   d = autoscroll mode
  87.   uResult = # of bytes transferred = length of uString
  88.         or -1 if a = -1 and no text was selected
  89.  
  90. BlokCIO 1566 a,b,c,d,uResult
  91. Moves a block of text to or from an editor where,
  92.   a = block I/O mode
  93.    -1 = read and deselect c bytes from selected text
  94.      0 = no I/O (but will autoscroll)
  95.    +1 = insert c bytes at beginning of selected text
  96.    +2 = insert c bytes after deleting selected text
  97.   b = address to read from or write to (must not be within an unlocked block)
  98.   c = # of bytes (characters) to read or write
  99.   d = autoscroll mode
  100.   uResult = number of bytes transferred Γëñ c
  101.  
  102. SvStCTxt 1569 [none]
  103. Saves current editor settings to the TREC resource on disk that is linked to the TextCt control.  Equivalent to choosing "Save" in the Editor Setup dialog.